620. 有趣的电影
# Write your MySQL query statement below
select 
    id,movie,description,rating
from 
    cinema
where 
    id%2=1 and description!="boring"
order by
    rating desc


面试题 02.08. 环路检测
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution {
    public:
        ListNode *detectCycle(ListNode *head) 
        {
            ListNode* faster=head;
            ListNode* slower=head;
    
            if(head==NULL||faster->next==NULL)
            {
                return NULL;
            }
    
            while(faster!=NULL)
            {
                slower=slower->next;
                faster=faster->next;
                if(faster!=nullptr && faster->next!=NULL)
                {
                    faster=faster->next;
                }
                else 
                {
                    return NULL;
                }
    
                if(faster==slower)
                {
                    break;
                }
            }   
    
            slower=head;
            while(slower!=faster)
            {
                slower=slower->next;
                faster=faster->next;
            }
            return slower;
        }
    };